home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16001 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: service-2.agate.net!usenet
  2. From: ettienne@agate.net (Steve Nutt)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: malloc() function and new operator
  5. Date: Tue, 09 Apr 1996 06:28:44 GMT
  6. Organization: DET
  7. Message-ID: <4kcom7$5u8@service-2.agate.net>
  8. References: <4kbo18$t1s@news.NetVision.net.il>
  9. Reply-To: ettienne@agate.net
  10. NNTP-Posting-Host: ettienne.sdi.agate.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. nir@netvision.net.il (Nir Sofer) wrote:
  14.  
  15. >I use in my C/C++ programs both malloc() function and new operator.
  16. >i use new and delete operators for objects and malloc() and free()
  17. >functions for allocating strings and other variables.
  18. >i compile my programs with Borland C++ 4.0 
  19. >it works fine, but i want to be sure that i'm not doing something
  20. >wrong that will cause troubles in the future.
  21.  
  22. >Is it o.k to use both of them in the same program ?
  23.  
  24. >Nir Sofer
  25. >nir@netvision.net.il
  26.  
  27. What you malloc you should free and what you new you should delete.
  28.  
  29. As long as you keep to that, you should be able to use malloc and new
  30. together.
  31.  
  32. Steve
  33.  
  34.